import request from "@/router/axios";

/**
 * 文件流返回
 * @param url 接口地址
 * @param params 接口参数
 */
export const exportBlob = (url, params) => {
  return request({
    url: url,
    params: params,
    method: "get",
    responseType: "blob",
  });
};
// 上传文件
export const uploadFile = (row) => {
  return request({
    url: "/api/file/uploadFile",
    method: "post",
    data: row,
  });
};

// 删除文件
export const removeFile = (row) => {
  return request({
    url: "/api/file/deleteFile",
    method: "post",
    data: row,
  });
};

// 文件签名
export const signFile = (params = {}) => {
  return request({
    url: "/api/file/fileSignature",
    method: "get",
    params: params,
  });
};

// 签名文件上传
export const signFileUpload = (url, data = {}) => {
  return request({
    url,
    method: "post",
    data: data,
  });
};
